#pragma once

#include "comutil.h"
#pragma comment(lib, "comsuppw.lib")

namespace UIStone
{
	struct I_FCPropertyHolder
	{
		virtual ~I_FCPropertyHolder() {}

		virtual _variant_t GetValue() = 0;
		virtual void SetValue(_variant_t& vtValue) = 0;
		virtual LPCWSTR GetTag() = 0;
	};

	template<typename T>
	class FCPropertyHolder : public I_FCPropertyHolder
	{
	public:
		FCPropertyHolder(T* pInnerFCProperty) : m_pInnerFCProperty(pInnerFCProperty) {}
		virtual ~FCPropertyHolder() {}

	public:
		virtual _variant_t GetValue()
		{
			return m_pInnerFCProperty->GetValue();
		};

		virtual void SetValue(_variant_t& vtValue)
		{
			m_pInnerFCProperty->GetValue() = vtValue;
		};

		virtual LPCWSTR GetTag()
		{
			return m_pInnerFCProperty->GetTag();
		}

	private:
		T* m_pInnerFCProperty;
	};
}